package com.tueye.service.impl.usermanager; 

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.tueye.base.util.Page;
import com.tueye.dao.usermanager.IUserDynamicDao;
import com.tueye.entity.Pictures;
import com.tueye.entity.user.UserDynamic;
import com.tueye.service.usermanager.IUserDynamicService;
import com.tueye.web.controller.blog.PagerModel;

/** 
 * @author 作者 yuyue E-mail: z_yuguangyue@126.com
 * @version 创建时间：Mar 27, 2009 6:35:56 PM 
 * Title:
 * Description:
 * ChangeDate:Mar 27, 2009 6:35:56 PM 
 * @ see 
 */
@Scope("prototype")
@Component("userDynamicService")
public class UserDynamicServiceImpl  implements IUserDynamicService{
	@Autowired
	@Qualifier("userDynamicDao")
  IUserDynamicDao userDynamicDao;
	
	@Override
	public void saveorUpdateUserDynamic(UserDynamic udc) {
		// TODO Auto-generated method stub
		userDynamicDao.saveorUpdateUserDynamic(udc);
	}

	@Override
	public PagerModel showUserDynamic(String hql, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		Page page = userDynamicDao.showUserDynamic(hql, currentPage, pageSize);
		 PagerModel pm = new PagerModel(); 
		 pm.setTotal(page.getTotalCount());
		 pm.setDatas((List<UserDynamic>)page.getResult()); 
		  return pm; 
	}
	
	

}
 